package com.jz.netthings.bloodsources.bean;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;

/**
 * <p>
 * 未献浆记录表
 * </p>
 *
 * @author 张凡
 * @since 2019-08-13
 */
public class XyNoPulping implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * Id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 浆员卡号
     */
    @TableField("cardId")
    private String cardId;
    /**
     * 浆员ID
     */
    @TableField("providerId")
    private Integer providerId;
    /**
     * 浆员姓名
     */
    @TableField("providerName")
    private String providerName;
    /**
     * 上次采浆日期
     */
    @TableField("lastCollDate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date lastCollDate;
    /**
     * 再次采浆时间
     */
    @TableField("agingCollDate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date agingCollDate;
    /**
     * 记录生成时间
     */
    @TableField("createTime")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 记录处理时间
     */
    @TableField("dealTime")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date dealTime;
    /**
     * 记录处理用时
     */
    @TableField("dealUseTime")
    private String dealUseTime;
    /**
     * 护士Id
     */
    @TableField("nurseId")
    private Integer nurseId;
    /**
     * 护士姓名
     */
    @TableField("nurseName")
    private String nurseName;
    /**
     * 护士部门ID
     */
    @TableField("nurseDeptId")
    private String nurseDeptId;
    /**
     * 总献浆量
     */
    @TableField("totalPulpingCount")
    private Integer totalPulpingCount;
    /**
     * 今年献浆量
     */
    @TableField("currentYearPulpingCount")
    private Integer currentYearPulpingCount;
    /**
     * 去年献浆量
     */
    @TableField("lastYearPulpingCount")
    private Integer lastYearPulpingCount;
    /**
     * 沟通次数
     */
    @TableField("conCount")
    private Integer conCount;
    /**
     * 沟通时间
     */
    @TableField("conTimes")
    private String conTimes;
    /**
     * 沟通内容|未献浆原因
     */
    @TableField("conCotent")
    private String conCotent;
    /**
     * 最近一次献浆时间
     */
    @TableField("collectionDate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date collectionDate;
    /**
     * 下次献浆时间
     */
    @TableField("nextCollDate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date nextCollDate;
    /**
     * 预计下次献浆时间
     */
    @TableField("estimateNextCollDate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date estimateNextCollDate;
    /**
     * 沟通状态
     */
    @TableField("conStatus")
    private Integer conStatus;
    /**
     * 是否已再次献浆
     */
    @TableField("isAgingPulping")
    private Integer isAgingPulping;
    /**
     * 是否外出务工
     */
    @TableField("isOutTask")
    private Integer isOutTask;
    /**
     * 备注
     */
    @TableField("remark")
    private String remark;
    /**
     * 最近一次沟通结果
     */
    @TableField(exist = false)
    private String lastConContent;

    /**
     * 是否血源提醒信息推送
     */
    @TableField("isPushMsg")
    private Integer isPushMsg;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    public Integer getProviderId() {
        return providerId;
    }

    public void setProviderId(Integer providerId) {
        this.providerId = providerId;
    }

    public String getProviderName() {
        return providerName;
    }

    public void setProviderName(String providerName) {
        this.providerName = providerName;
    }

    public Date getLastCollDate() {
        return lastCollDate;
    }

    public void setLastCollDate(Date lastCollDate) {
        this.lastCollDate = lastCollDate;
    }

    public Date getAgingCollDate() {
        return agingCollDate;
    }

    public void setAgingCollDate(Date agingCollDate) {
        this.agingCollDate = agingCollDate;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getDealTime() {
        return dealTime;
    }

    public void setDealTime(Date dealTime) {
        this.dealTime = dealTime;
    }

    public String getDealUseTime() {
        return dealUseTime;
    }

    public void setDealUseTime(String dealUseTime) {
        this.dealUseTime = dealUseTime;
    }

    public Integer getNurseId() {
        return nurseId;
    }

    public void setNurseId(Integer nurseId) {
        this.nurseId = nurseId;
    }

    public String getNurseName() {
        return nurseName;
    }

    public void setNurseName(String nurseName) {
        this.nurseName = nurseName;
    }

    public String getNurseDeptId() {
        return nurseDeptId;
    }

    public void setNurseDeptId(String nurseDeptId) {
        this.nurseDeptId = nurseDeptId;
    }

    public Integer getTotalPulpingCount() {
        return totalPulpingCount;
    }

    public void setTotalPulpingCount(Integer totalPulpingCount) {
        this.totalPulpingCount = totalPulpingCount;
    }

    public Integer getCurrentYearPulpingCount() {
        return currentYearPulpingCount;
    }

    public void setCurrentYearPulpingCount(Integer currentYearPulpingCount) {
        this.currentYearPulpingCount = currentYearPulpingCount;
    }

    public Integer getLastYearPulpingCount() {
        return lastYearPulpingCount;
    }

    public void setLastYearPulpingCount(Integer lastYearPulpingCount) {
        this.lastYearPulpingCount = lastYearPulpingCount;
    }

    public Integer getConCount() {
        return conCount;
    }

    public void setConCount(Integer conCount) {
        this.conCount = conCount;
    }

    public String getConTimes() {
        return conTimes;
    }

    public void setConTimes(String conTimes) {
        this.conTimes = conTimes;
    }

    public String getConCotent() {
        return conCotent;
    }

    public void setConCotent(String conCotent) {
        this.conCotent = conCotent;
    }

    public Date getCollectionDate() {
        return collectionDate;
    }

    public void setCollectionDate(Date collectionDate) {
        this.collectionDate = collectionDate;
    }

    public Date getNextCollDate() {
        return nextCollDate;
    }

    public void setNextCollDate(Date nextCollDate) {
        this.nextCollDate = nextCollDate;
    }

    public Date getEstimateNextCollDate() {
        return estimateNextCollDate;
    }

    public void setEstimateNextCollDate(Date estimateNextCollDate) {
        this.estimateNextCollDate = estimateNextCollDate;
    }

    public Integer getConStatus() {
        return conStatus;
    }

    public void setConStatus(Integer conStatus) {
        this.conStatus = conStatus;
    }

    public Integer getIsAgingPulping() {
        return isAgingPulping;
    }

    public void setIsAgingPulping(Integer isAgingPulping) {
        this.isAgingPulping = isAgingPulping;
    }

    public Integer getIsOutTask() {
        return isOutTask;
    }

    public void setIsOutTask(Integer isOutTask) {
        this.isOutTask = isOutTask;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getIsPushMsg() {
        return isPushMsg;
    }

    public void setIsPushMsg(Integer isPushMsg) {
        this.isPushMsg = isPushMsg;
    }

    public String getLastConContent() {
        if(this.conCotent!=null && !"".equals(this.conCotent)
                &&this.conCotent.contains("[")
                &&this.conCotent.contains("]")
        ){
            JSONArray jsonArray =  JSONArray.parseArray(this.conCotent);
            if(jsonArray!=null){
                this.lastConContent=jsonArray.getJSONObject((jsonArray.size()-1)).getString("conContent");
                return this.lastConContent;
            }else{
                this.lastConContent = lastConContent;
                return  this.lastConContent;
            }
        }else{
            return this.lastConContent;
        }
    }
    public void setLastConContent(String lastConContent) {
        if(this.conCotent!=null && !"".equals(this.conCotent)
                &&this.conCotent.contains("[")
                &&this.conCotent.contains("]")
           ){
           JSONArray jsonArray =  JSONArray.parseArray(this.conCotent);
            if(jsonArray!=null){
                this.lastConContent=jsonArray.getJSONObject((jsonArray.size()-1)).getString("conContent");
            }else{
                this.lastConContent = lastConContent;
            }
        }else{
            this.lastConContent = lastConContent;
        }
    }

    @Override
    public String toString() {
        return "XyNoPulping{" +
        "id=" + id +
        ", cardId=" + cardId +
        ", providerId=" + providerId +
        ", providerName=" + providerName +
        ", lastCollDate=" + lastCollDate +
        ", agingCollDate=" + agingCollDate +
        ", createTime=" + createTime +
        ", dealTime=" + dealTime +
        ", dealUseTime=" + dealUseTime +
        ", nurseId=" + nurseId +
        ", nurseName=" + nurseName +
        ", nurseDeptId=" + nurseDeptId +
        ", totalPulpingCount=" + totalPulpingCount +
        ", currentYearPulpingCount=" + currentYearPulpingCount +
        ", lastYearPulpingCount=" + lastYearPulpingCount +
        ", conCount=" + conCount +
        ", conTimes=" + conTimes +
        ", conCotent=" + conCotent +
        ", collectionDate=" + collectionDate +
        ", nextCollDate=" + nextCollDate +
        ", estimateNextCollDate=" + estimateNextCollDate +
        ", conStatus=" + conStatus +
        ", isAgingPulping=" + isAgingPulping +
        ", isOutTask=" + isOutTask +
        ", remark=" + remark +
        "}";
    }
}
